package jp.ac.aiit.spg.web.wbs;

import org.seasar.teeda.extension.annotation.scope.PageScope;

public class ConfirmTaskPage  {
	
	private String message;

	@PageScope
	private String taskName;

	private String operation;
	
	private String previousViewId;
	
	private int projectid;

	
	public int getProjectid() {
		return projectid;
	}

	public void setProjectid(int projectid) {
		this.projectid = projectid;
	}

	public String getPreviousViewId() {
		return previousViewId;
	}

	public void setPreviousViewId(String previousViewId) {
		this.previousViewId = previousViewId;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}


	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Class initialize() {
		if (previousViewId.equals("/view/wbs/createTask.html")) { this.setOperation("作成");				} ; // "CreateTask.html"ではエラーになる 
 		if (previousViewId.equals("/view/wbs/UpdateTask.html")) { this.setOperation("更新");				} ;  
		if (previousViewId.equals("/view/wbs/DeleteTask.html")) { this.setOperation("削除");				} ;  
		message = "タスク <" + this.getTaskName() + "> を" + this.getOperation() + "しました。";
		return null;
	}

	public Class prerender() {
		return null;
	}

	public Class doReturn() {
		return ListTasksPage.class;
	}


}
